1. Field of the Invention
The present invention relates to a numerical control apparatus having a machining program editing function for numerical control machine tools.
2. Description of the Related Art
Machining operations of numerical control machine tools are performed according to machining programs which, in general, are in the form of one or more consecutive machining step unit programs PUT (i) each defining the operation at one machining step. In the case of numerical control machine tools each having one headstock and tool rest, it is possible to change the sequence of the execution of machining programs by rearranging the above machining step unit programs PUT (i).
The manner of changing the sequence of the execution of a machining program will be described for the case of the numerical control machine tools having a plurality of headstocks or a plurality of tool rests. As numerical control machine tools having a plurality of the headstocks or a plurality of the tool rests, 2-saddle machine tools having one headstock and two tool rests which are aimed for improving processing efficiency by means of simultaneous machining, and 2-spindle machine tools having two headstocks and at least one tool rest which are aimed for improving machining's efficiency by means of integral machining, have been proposed.
The machining operation is carried out by controlling the relative movement of the headstocks and the tool rests. As to the numerical control machine tools having a plurality of the headstocks or a plurality of tool rests, there is a plurality of combinations of the headstocks and the tool rests which can perform machining operations and, therefore, such numerical control machine tools generally have a plurality of control processes each configurated so as to be able to independently perform operations to control the headstocks and the tool rests.
A machining step unit program PUT (i) of such numerical control machine tools consists of a control process definition command TRC (i) and a spindle operation command PRC (i). The control process definition command TRC (i) defines the control process which is related to the contents of the spindle operation command PRC (i) which has been given thereafter.
As to the control process specified by the control process definition command TRC (i), the control process specified by the previous control process definition command TRC (i) is effective until a new control process is defined, and the defined state is kept in the subsequent spindle operation command PRC (i). The spindle operation command PRC (i) includes a spindle transfer command and, if necessary, spindle rotation speed commands RPM (i), spindle rotation command ROT (i), tool change command TOL (i), and synchronization command SYN (i). At the beginning of the blocks of the control process definition command TRC (i) and the spindle operation command PRC (i), labels LAB are commanded. The synchronization command SYN (i) is given to provide synchronization of spindle operation command PRC (i) between different control processes in order to perform simultaneous machining, or to define the sequence of the execution of the spindle operation command PRC (i) between control processes which can not be executed in parallel.
FIG. 1 is a schematic diagram showing an example of the numerical control machine tools having a plurality of headstocks or a plurality of tool rests, which is equipped with two headstocks and two tool rests. The two headstocks are disposed on both sides of a machine body 2-1 so as to face each other, and a first headstock 2-2 and a second headstock 2-3 are supported so as to be movable in the directions of a Z1-axis and a Z2-axis, respectively. Spindles 2-2a and 2-3a are supported by the headstocks 2-2 and 2-3 with a common axis of rotation CT1. In addition, chucks 2-2b and 2-3b are mounted on the ends of the spindles 2-2a and 2-3a, respectively. The chucks 2-2b and 2-3b hold work pieces 2-4 and 2-5, respectively.
The two tool rests are disposed so as to sandwitch the axis of rotation CT1. The first tool rest 2-6 is supported so as to be movable in the direction of an X1-axis while the second tool rest 2-7 is disposed so as to be movable in the directions of a Z3-axis and a X2-axis. Turrets 2-6a and 2-7a which are formed like a polygonal tube, are mounted on the tool rests 2-6 and 2-7, respectively, and cutting tools 2-8 and 2-9 are mounted on the turrets 2-6a and 2-7a, respectively.
With the configuration as described above, after the work 2-4 undergoes a front step machining on the first headstock 2-2, it is transferred from the first headstock 2-2 to the second headstock 2-3 by which it is held to receive a back step machining. In other words, the work 2-5 is a work on which the front step machining has been completed.
In this example, there are four combinations of the headstocks and the tool rests with which machining can be carried out and, therefore, four control processes for respective combinations are considered and the control process definition commands TRC (i) for respective control processes are given as follows.
G13=a first control process (the combination of the first headstock and the first tool rest) PA1 G14=a second control process (the combination of the first headstock and the second tool rest) PA1 G15=a third control process (the combination of the second headstock and the first tool rest) PA1 G16=a fourth control process (the combination of the second headstock and the second tool rest) PA1 P (**)=performing synchronization with a control process which does not share the tool rest PA1 Q (**)=performing synchronization with a control process which shares the tool rest. **: figure PA1 TRC (1)=G13 PA1 TRC (2)=G13 PA1 TRC (3)=G13 PA1 TRC (4)=G16 PA1 TRC (5)=G16 PA1 TRC (6)=G16 PA1 (1) Replace the machining step unit program units as follows. PA1 (2) Change the control process definition command as follows. PA1 (3) Set the synchronization commands as follows.
Simultaneous machining of the front and back step machinings can be carried out by a parallel operation of the first and second control processes and a parallel operation of the third and fourth control processes. Synchronization commands SYN (i) defining such parallel operations are given as follows.
**: figure PA2 PUT (1).fwdarw.PUT' (2) PA2 PUT (2).fwdarw.PUT' (3) PA2 PUT (3).fwdarw.PUT' (1) PA2 TRC' (2): G13.fwdarw.G14 PA2 SYN' (1): P (10) Q (10) PA2 SYN' (2): P (10) Q (10) PA2 SYN' (3): P (20) Q (20) PA2 SYN' (4): P (30) Q (30) PA2 SYN' (5): P (20) Q (20) PA2 SYN' (6): P (30) Q (30) PA2 SYN' (1): P (10) PA2 SYN' (2): P (10) Q (10) PA2 SYN' (3): P (20) PA2 SYN' (4): PA2 SYN' (5): P (20) PA2 SYN' (6):
Rule for the synchronization: Blocks including a synchronization command SYN (i) can not be executed when the figure shown in P (**) is greater than the figure shown in the P (**) of a process to control the object to which synchronization is to be achieved.
Further, a parallel operation of the first and third operations and a parallel operation of the second and fourth operations can not be carried out because those operations share the same tool rest. Synchronization command SYN (i) which sequences such operations is expressed as:
Rule for the synchronization: Blocks including a synchronization command SYN (i) can not be executed when the figure shown in Q (**) is greater than the figure shown in the Q (**) of a process to control the object to which synchronization is to be achieved.
Though the control process definition command is expressed by a G-code and the synchronization command is expressed by a P- and a Q-code here, other codes may be used.
FIG. 2 shows an example of a machining method wherein the front and back step machinings are defined as independent machinings in the above-mentioned numerical control machine tool with the axis of abscissa representing machining time and wherein the front step machining comprises machining steps from a first machining step to a fourth machining step and the back step machining comprises fifth and sixth machining steps. The machining program PRO of the machining shown in FIG. 2 is in a configuration wherein machining step unit programs PUT (1) to PUT (6) defining the operation of the machinings from the first machining step to the sixth machining step are consecutively provided as shown in FIG. 3.
Since a control machining definition command TRC (i) is held until a new control process is defined, the control process definition commands TRC (2), TRC (3), TRC (4) and TRC (6) may be deleted. Further, since the machining shown in FIG. 2 includes neither simultaneous machining steps nor machining steps which share the tool rest, no synchronization command SYN (i) is issued. P
Since there is a great difference (T2-T1) in the machining time between the machining time T2 for the front step machining and the machining time T1 for the back step machining, it is necessary to shorten the machining time of the front step machining so as to achieve an efficient balance between the cycles of the tool rests in order to carry out the machining efficiently. If the first and third machining steps can be carried out simultaneously, it is necessary to carry out the first and third machining steps simultaneously as shown in FIG. 6 while correcting the sequence of the execution of the machining program so that the back step machining (fifth and sixth machining steps) are started immediately after the completion of the first machining step.
FIG. 4 is a flow chart illustrating the procedure for the correction of the execution sequence of the machining program, and FIG. 5 shows a display device and an input device of a numerical control device, which are the means for the above correction. The machining program is displayed on a screen 12-1 and a cursor 12-6 is moved to a top block of a machining step unit program to be moved by operating a page key 12-4 and a cursor key 12-3 (Step S1) to cut the machining step unit program (Step S2). The cursor 12-6 is then moved to the block to which the cut machining step unit program is to be moved (Step S3) and the cut machining step unit program is inserted therein (Step S4). The above Steps S1 to S4 are carried out for each machining step unit program to be moved (Step S5). The cutting and insertion of the machining step unit programs as described above can be carried out by pressing a function key 12-5.
Similarly, correction of a control process definition command or a synchronization command is carried out by moving the cursor 12-6 to the location to be corrected by operating the page key 12-4 and the cursor key 12-3, and by inputting characters and numerals with the keyboard 12-2 directly (Steps S6 to S9). The above Steps S6 to S9 are also carried out for each of machining step unit program to be corrected (Step S10).
FIG. 7 shows the machining program PRO' for the machining shown in FIG. 6. In order to form the machining program PRO', it is necessary to make the following correction on the machining program PRO as shown in FIG. 3 when the machining step unit programs of the machining program PRO' are PUT' (1) through PUT' (6).
A synchronization command SYN (i) is also held until a new command is given just as a control process definition command TRC (i) and, therefore, it can be deleted as shown below.
In the conventional numerical control apparatus as described above, a very small number of blocks can be displayed on the screen when compared with the total number of the blocks of the machining program. Thus, the page key and the cursor key must be pressed many times to find the locations to be corrected and, in addition, in the case of the numerical control machine tools having a plurality of headstocks or a plurality of tool rests, there is a great burden to operators who must have understanding of control process definition commands and synchronization commands. Moreover, since codes and numerical values must be directly input, a problem arises in that input errors easily occur causing troubles in practical machining operations.